﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CardInChina.Web.Mvc
{
    public class RedirectToLoginResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            context.HttpContext.Response.StatusCode = 302;
            context.HttpContext.Response.RedirectLocation = "/user/login?ReturnUrl=" + context.HttpContext.Request.Url.AbsolutePath;
            context.HttpContext.Response.StatusDescription = "session expired.";
        }
    }

    public class RedirectToEmailVerifyResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            context.HttpContext.Response.StatusCode = 302;
            context.HttpContext.Response.RedirectLocation = "/user/email-not-verified";
            context.HttpContext.Response.StatusDescription = "email not verified.";
        }
    }

    public class RedirectToAccountActivateResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            throw new NotImplementedException();
        }
    }

    public class RedirectToPaypalActivateResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            throw new NotImplementedException();
        }
    }

    public class RedirectToVipActivateResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            throw new NotImplementedException();
        }
    }
}